public class Test1 {

    public static void main(String[] args) {
        int[] arr={12,3,4};

        try{
           // System.out.println(arr[100]);
           // arr=null;
            System.out.println(arr.length);

        }catch(ArrayIndexOutOfBoundsException e){
            System.out.println("这是数组越界异常：");
            e.printStackTrace();
        }
        catch(NullPointerException e){
            System.out.println("这是空指针异常：");
            e.printStackTrace();
        }finally {
            System.out.println("finally的代码一定会被执行");
        }
    }
}
